﻿
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MyMES.Domain.zyy;
using MyMES.Error;
using MyMES.Writer.API.Application.Commends.Roles;



namespace MyMES.Writer.API.Controllers.Roless
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class RoleController : ControllerBase
    {
        private readonly IMediator med;

        public RoleController(IMediator med)
        {
            this.med = med;
        }
        //[HttpPost]
        //public async Task<APIResult<Role>> AddRoles(AddRolecommand command)
        //{
        // return await med.Send(command);
        //}


        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// 
        [HttpPost]
   
        public async Task<APIResult<Role>> AddRoles(AddRolecommand command)
        {
            return await med.Send(command);
        }
    }
}
